home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / util / whichrx1.2 / which.rexx
OS/2 REXX Batch file  |  1990-02-01  |  685b  |  41 lines

  1. /*  which.rexx
  2.  
  3.     A shell for C:Which that knows of WShell's global path
  4.  
  5.     $Author: jh $
  6.     $Date: 90/01/30 23:13:34 $
  7.     $Revision: 1.2 $
  8.     $State: Exp $
  9.  
  10.     $Log:    which.rexx,v $
  11.     Revision 1.2  90/01/30    23:13:34  jh
  12.     Check for the existance of a global path in ENV:Path
  13.  
  14.     Revision 1.1  90/01/30    21:07:48  jh
  15.     Initial revision
  16.  
  17. */
  18.  
  19. FailAt 30
  20.  
  21. Parse Arg args
  22.  
  23. if ~ Exists('ENV:Path') then do
  24.     "C:Which" args
  25.     exit
  26.     end
  27.  
  28. "Path Show | ExecIO From 2 Stem oldpath."
  29. localpath = ''
  30. do i = 1 to oldpath.0 - 1
  31.     localpath = localpath' 'oldpath.i
  32.     end
  33.  
  34. "ExecIO Read ENV:Path For 1 Var globalpath"
  35.  
  36. "Path Add" globalpath
  37. "C:Which" args
  38.  
  39. "Path Reset"
  40. "Path Add" localpath
  41.